<template>
<div>
  <div>
    <Menu></Menu>
  </div>
  <div class="ec-main">
    <!-- 电量 -->
    <div class="electric-charge">
      <div class="electric-charge-date">
        <el-date-picker
          v-model="value"
          align="left"
          type="date"
          placeholder="选择日期"
        >
        </el-date-picker>
      </div>
      <hr color="#ECECEC">
      <div class="electric-charge-content">
        <div class="charge-ratio-left">
          <div class="charge-ratio-left-title">
            <div class="total-electrical-output-title">总发电量:</div>
            <div class="total-electrical-use-title">总用电量:</div>
            <div clsss="energy-storage-title">储能电量:</div>
          </div>
          <div class="charge-ratio-left-num">
            <div class="total-electrical-output-num">{{ totalElectricalOutput }}</div>
            <div class="total-electrical-use-num">{{ totalElectricalUse }}</div>
            <div class="energy-storage-num">{{ energyStorage }}</div>
          </div>
          <div class="charge-ratio-left-unit">
            <div class="total-electrical-output-unit">kWH</div>
            <div class="total-electrical-use-unit">kWH</div>
            <div class="energy-storage-unit">kWH</div>
          </div>
        </div>
        <div class="charge-ratio-middle">
          <div id="power-generation-ratio"></div>
        </div>
        <div class="charge-ratio-right">
          <div id="power-use-ratio"></div>
        </div>
      </div>
    </div>
    <!-- 安全运行 -->
    <div class="safe-run-content">
      <div class="safe-run-days">
        <div class="safe-run-days-img">
          <img src="../../static/img/safe.png" alt=""><span>安全运行</span>
        </div>
        <div class="safe-run-days-count">143</div>
        <div class="safe-run-days-unit">天</div>
      </div>
    </div>
    <!-- 数据 -->
    <div class="safe-run-data">
      <div class="alternating-generatrix-voltage"><span>交流母线电压:</span><span class="alternating-generatrix-voltage-data">227.8</span><span>V</span></div>
      <div class="running-state"><span>运行状态:</span><span class="running-state-content">并网运行</span></div>
      <div class="dc-generatrix-voltage"><span>直流母线电压:</span><span class="dc-generatrix-voltage-data">110.7</span><span>V</span></div>
      <div class="dot-power"><span>并网点功率:</span><span class="dot-power-data">123.8</span><span>kW</span></div>
      <div class="system-frequency"><span>系统频率:</span><span class="system-frequency-data">55</span><span>HZ</span></div>
    </div>
    <div class="microgrid-dist">
      <!-- 微网发用电分布 -->
      <div id="microgrid-elec-dist"></div>
      <!-- 微网运行费用分布 -->
      <div id="microgrid-cost-dist"></div>
    </div>
    <div class="microgrid-electric">
      <!-- 光伏发电功率 -->
      <div id="pvp-generation"></div>
      <!-- 微网用电 -->
      <div id="microgrid-electric-use"></div>
    </div>
    <div class="energy-store-electric">
      <!-- 储能充放电功率 -->
      <div id="energy-store-electric-power"></div>
      <!-- 充电对比图 -->
      <div id="charge-contrast"></div>
    </div>
  </div>
</div>
</template>
<script>
import echarts from 'echarts';
import { throttle } from '../common';
import Menu from './Menu';
import TWEEN from 'tween.js';
export default {
  components: {
    Menu
  },
  data () {
    return {
      totalElectricalOutput: 86.984,
      totalElectricalUse: 865,
      energyStorage: 547,
      safeRunningDays: 143,
      menuShow: false,
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
        shortcuts: [{
          text: '今天',
          onClick(picker) {
            picker.$emit('pick', new Date());
          }
        }, {
          text: '昨天',
          onClick(picker) {
            const date = new Date();
            date.setTime(date.getTime() - 3600 * 1000 * 24);
            picker.$emit('pick', date);
          }
        }, {
          text: '一周前',
          onClick(picker) {
            const date = new Date();
            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', date);
          }
        }]
      },
      value: ''
    };
  },
  watch: {
    totalElectricalOutput (newVal, oldVal) {
      var tween = new TWEEN.Tween(oldVal);
      tween.to(newVal, 3000);
      tween.start();
    }
  },
  mounted () {
    this.powerGenerationRatioChart = echarts.init(document.getElementById('power-generation-ratio'));
    this.powerUseRatioChart = echarts.init(document.getElementById('power-use-ratio'));
    this.microElectricityDist = echarts.init(document.getElementById('microgrid-elec-dist'));
    this.microCostDist = echarts.init(document.getElementById('microgrid-cost-dist'));
    this.pvpGeneration = echarts.init(document.getElementById('pvp-generation'));
    this.microgridElectricUse = echarts.init(document.getElementById('microgrid-electric-use'));
    this.energyStoreElectricPower = echarts.init(document.getElementById('energy-store-electric-power'));
    this.chargeContrast = echarts.init(document.getElementById('charge-contrast'));
    this.resizeChart = throttle(500, false, () => {
      this.powerUseRatioChart.resize();
      this.powerGenerationRatioChart.resize();
      this.microElectricityDist.resize();
      this.microCostDist.resize();
      this.pvpGeneration.resize();
      this.microgridElectricUse.resize();
      this.energyStoreElectricPower.resize();
      this.chargeContrast.resize();
    });
    window.addEventListener('resize', this.resizeChart);
    this.drawPowerGenerationRatio();
    this.drawPowerUseRatio();
    this.drawMicroElectricityDist();
    this.drawMicrogridCostDist();
    this.drawPvpGeneration();
    this.drawMicrogridElectricUse();
    this.drawEnergyStoreElectricPower();
    this.drawChargeContrast();
  },
  methods: {
    // 绘制发电量占比
    drawPowerGenerationRatio () {
      var width = getComputedStyle(document.querySelector('#power-generation-ratio')).width.replace('px', '');
      var center = '';
      var radius = '';
      if (width === '350') {
        radius = '55%';
        center = [175, 175];
      } else {
        radius = '50%';
        center = [150, 150];
      }
      var option = {
        title: {
          text: '发电量占比',
          x: 'center',
          textStyle: {
            fontWeight: 'normal',
            fontSize: 16,
            lineHeight: 22,
            color: '#333333'
          }
        },
        series: [
          {
            type: 'pie',
            radius,
            center,
            itemStyle: {
              normal: {
                color: function(params) {
                  var colorList = [
                    '#F48686', '#F8CA6D', '#7ECAF1', '#B2DB8E'
                  ];
                  return colorList[params.dataIndex];
                }
              }
            },
            label: {
              normal: {
                formatter: value => {
                  var name = value.name;
                  var percentValue = value.percent.toFixed(0);
                  var percent = '%';
                  return `${name}\n${percentValue}${percent}`;
                },
                textStyle: {
                  fontSize: 16
                },
                rich: {
                  percentValue: {
                    fontSize: 16,
                    lineHeight: 43
                  },
                  percent: {
                    fontSize: 16
                  }
                }
              }
            },
            data: [
              { value: 0, name: '电网' },
              { value: 0, name: '光伏' },
              { value: 0, name: '储能放电' },
              { value: 0, name: '汽车放电' }
            ]
          }
        ]
      };
      this.powerGenerationRatioChart.setOption(option);
    },
    //  绘制用电量占比
    drawPowerUseRatio () {
      var width = getComputedStyle(document.querySelector('#power-use-ratio')).width.replace('px', '');
      var center = '';
      var radius = '';
      if (width === '350') {
        radius = '55%';
        center = [175, 175];
      } else {
        radius = '50%';
        center = [150, 150];
      }
      var option = {
        title: {
          text: '用电量占比',
          x: 'center',
          textStyle: {
            fontWeight: 'normal',
            fontSize: 16,
            lineHeight: 22,
            color: '#333333'
          }
        },
        series: [
          {
            type: 'pie',
            radius,
            center,
            itemStyle: {
              normal: {
                color: function(params) {
                  var colorList = [
                    '#63A7E8', '#938CD4', '#B2DB8E', '#F48686'
                  ];
                  return colorList[params.dataIndex];
                }
              }
            },
            label: {
              formatter: value => {
                var name = value.name;
                var percentValue = value.percent.toFixed(0);
                var percent = '%';
                return `${name}\n${percentValue}${percent}`;
              },
              textStyle: {
                fontSize: 16
              },
              rich: {
                percentValue: {
                  fontSize: 16,
                  lineHeight: 43
                },
                percent: {
                  fontSize: 16
                }
              }
            },
            data: [
              { value: 0, name: '储能充电' },
              { value: 0, name: '卖给电网' },
              { value: 0, name: '工业负荷' },
              { value: 0, name: '汽车充电' }
            ]
          }
        ]
      };
      this.powerUseRatioChart.setOption(option);
    },
    // 绘制微网发用电分布
    drawMicroElectricityDist () {
      var legend = [];
      if (this.clientWidth > 500) {
        legend = [
          {
            top: 40,
            width: 600,
            itemWidth: 14,
            itemGap: 32,
            textStyle: {
              color: '#666666',
              fontSize: 14,
              padding: [0, 0, 0, 10]
            },
            data: [{
              name: '电网',
              icon: 'circle'
            },
            {
              name: '光伏',
              icon: 'circle'
            },
            {
              name: '储能放电',
              icon: 'circle'
            },
            {
              name: '汽车放电',
              icon: 'circle'
            }            
            ]
          },
          {
            top: 60,
            width: 600,
            itemWidth: 14,
            itemGap: 32,
            textStyle: {
              color: '#666666',
              fontSize: 14,
              padding: [0, 0, 0, 10]
            },
            data: [{
              name: '储能充电',
              icon: 'circle'
            },
            {
              name: '卖给电网',
              icon: 'circle'
            },
            {
              name: '工业负荷',
              icon: 'circle'
            },
            {
              name: '汽车充电',
              icon: 'circle'
            }            
            ]
          }
        ]
      } else {
        legend = [
          {
            top: 40,
            width: 600,
            itemWidth: 14,
            itemGap: 32,
            textStyle: {
              color: '#666666',
              fontSize: 14,
              padding: [0, 0, 0, 10]
            },
            data: [{
              name: '电网',
              icon: 'circle'
            },
            {
              name: '光伏',
              icon: 'circle'
            },
            {
              name: '储能放电',
              icon: 'circle'
            }]
          },
          {
            top: 60,
            width: 600,
            itemWidth: 14,
            itemGap: 32,
            textStyle: {
              color: '#666666',
              fontSize: 14,
              padding: [0, 0, 0, 10]
            },
            data: [{
              name: '汽车放电',
              icon: 'circle'
            },
            {
              name: '储能充电',
              icon: 'circle'
            },
            {
              name: '卖给电网',
              icon: 'circle'
            }]
          },
          {
            top: 80,
            width: 600,
            itemWidth: 14,
            itemGap: 32,
            textStyle: {
              color: '#666666',
              fontSize: 14,
              padding: [0, 0, 0, 10]
            },
            data: [{
              name: '工业负荷',
              icon: 'circle'
            },
            {
              name: '汽车充电',
              icon: 'circle'
            }]
          }
        ]
      }
      var option = {
        title: {
          text: '微网发用电分布',
          x: 20,
          textStyle: {
            fontWeight: 'normal',
            fontSize: 20,
            lineHeight: 28,
            color: '#666666'
          }
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              backgroundColor: 'transparent',
              color: 'transparent'
            }
          },
          color: '#FFFFFF',
          backgroundColor: 'rgba(0,0,0,0.33)'
        },
        grid: {
          x: 50,
          top: 150,
          x2: 50
        },
        legend,
        xAxis: {
          type: 'category',
          boundaryGap: false,
          name: '时间',
          nameTextStyle: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          },
          nameGap: 12,
          data: ['2018-09-21', '2018-09-22', '2018-09-22', '2018-09-23', '2018-09-24', '2018-09-25', '2018-09-26', '2018-09-27'],
          axisLine: {
            show: false,
            onZero: true
          },
          axisTick: {
            show: false
          },
          axisLabel: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          }
        },
        yAxis: {
          type: 'value',
          name: 'kW·h',
          nameLocation: 'end',
          nameTextStyle: {
            color: '#999',
            fontSize: 14,
            lineHeight: 20
          },
          axisLine: {
            show: false
          },
          axisTick: {
            show: false
          },
          axisLabel: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          },
          splitNumber: 3,
          splitLine: {
            show: false
          },
          scale: true
        },
        series: [
          {
            name: '电网',
            type: 'line',
            stack: '发电总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#9FD7F4'
              }
            },
            data: [30, 40, 50, 60, 50, 40, 30, 35],
            smooth: true
          },
          {
            name: '光伏',
            type: 'line',
            stack: '发电总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#F09595'
              }
            },
            data: [35, 45, 55, 65, 55, 45, 35, 40],
            smooth: true
          },
          {
            name: '储能放电',
            type: 'line',
            stack: '发电总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#AABB33'
              }
            },
            data: [35, 45, 55, 65, 55, 45, 35, 40],
            smooth: true
          },
          {
            name: '汽车放电',
            type: 'line',
            stack: '发电总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#c1590d'
              }
            },
            data: [40, 50, 60, 70, 80, 50, 60, 45],
            smooth: true
          },          
          {
            name: '储能充电',
            type: 'line',
            stack: '用电总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#80BAF2'
              }
            },
            data: [-45, -50, -70, -80, -65, -55, -50, -50],
            smooth: true
          },
          {
            name: '卖给电网',
            type: 'line',
            stack: '用电总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#CAEAA9'
              }
            },
            data: [-60, -60, -65, -80, -80, -80, -70, -65],
            smooth: true
          },
          {
            name: '工业负荷',
            type: 'line',
            stack: '用电总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#B4ACF5'
              }
            },
            data: [-65, -65, -70, -85, -85, -85, -75, -65],
            smooth: true
          },
          {
            name: '汽车充电',
            type: 'line',
            stack: '用电总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#62b392'
              }
            },
            data: [-65, -65, -70, -85, -85, -85, -75, -65],
            smooth: true
          }          
        ]
      };
      this.microElectricityDist.setOption(option);
    },
    // 绘制微网运行费用分布
    drawMicrogridCostDist () {
      var legend = [];
      if (this.clientWidth > 500) {
        legend = [
          {
            top: 60,
            width: 600,
            itemWidth: 14,
            itemGap: 32,
            textStyle: {
              color: '#666666',
              fontSize: 14,
              padding: [0, 0, 0, 10]
            },
            data: [  
              {
                name: '负荷用电电费',
                icon: 'circle'
              },
              {
                name: '电池充电花费',
                icon: 'circle'
              },
              {
                name: '电池放电收益',
                icon: 'circle'
              }
            ]
          },
          {
            top: 80,
            width: 600,
            itemWidth: 14,
            itemGap: 32,
            textStyle: {
              color: '#666666',
              fontSize: 14,
              padding: [0, 0, 0, 10]
            },
            data: [
              {
                name: '汽⻋放电收益',
                icon: 'circle'
              },
              {
                name: '光伏消纳节约',
                icon: 'circle'
              },
              {
                name: '光伏并⽹收益',
                icon: 'circle'
              }
            ]
          }
        ];
      } else {
        legend = [
          {
            top: 40,
            width: 600,
            itemWidth: 14,
            itemGap: 32,
            textStyle: {
              color: '#666666',
              fontSize: 14,
              padding: [0, 0, 0, 10]
            },
            data: [  
              {
                name: '负荷用电电费',
                icon: 'circle'
              },
              {
                name: '电池充电花费',
                icon: 'circle'
              }
            ]
          },
          {
            top: 60,
            width: 600,
            itemWidth: 14,
            itemGap: 32,
            textStyle: {
              color: '#666666',
              fontSize: 14,
              padding: [0, 0, 0, 10]
            },
            data: [
              {
                name: '电池放电收益',
                icon: 'circle'
              },
              {
                name: '汽⻋放电收益',
                icon: 'circle'
              }
            ]
          },
          {
            top: 80,
            width: 600,
            itemWidth: 14,
            itemGap: 32,
            textStyle: {
              color: '#666666',
              fontSize: 14,
              padding: [0, 0, 0, 10]
            },
            data: [
              {
                name: '光伏消纳节约',
                icon: 'circle'
              },
              {
                name: '光伏并⽹收益',
                icon: 'circle'
              }
            ]
          }
        ];
      }
      var option = {
        title: {
          text: '微网运行费用分布',
          x: 20,
          textStyle: {
            fontWeight: 'normal',
            fontSize: 20,
            lineHeight: 28,
            color: '#666666'
          }
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              backgroundColor: 'transparent',
              color: 'transparent'
            }
          },
          color: '#FFFFFF',
          backgroundColor: 'rgba(0,0,0,0.33)'
        },
        grid: {
          x: 50,
          y: 150,
          x2: 50
        },
        legend,
        xAxis: [
          {
            type: 'category',
            boundaryGap: false,
            name: '时间',
            nameTextStyle: {
              color: '#999999',
              fontSize: 14,
              lineHeight: 20
            },
            data: ['2018-09-21', '2018-09-22', '2018-09-22', '2018-09-23', '2018-09-24', '2018-09-25', '2018-09-26', '2018-09-27'],
            axisLine: {
              show: false,
              onZero: false,
              lineStyle: {
                color: '#999999'
              }
            },
            axisTick: {
              show: false
            },
            axisLabel: {
              color: '#999999',
              fontSize: 14,
              lineHeight: 20
            }
          }
        ],
        yAxis: [
          {
            type: 'value',
            name: '元',
            nameTextStyle: {
              color: '#999999',
              fontSize: 14,
              lineHeight: 20
            },
            axisLine: {
              show: false
            },
            axisTick: {
              show: false
            },
            axisLabel: {
              color: '#999999',
              fontSize: 14,
              lineHeight: 20
            },
            splitLine: false
          }
        ],
        series: [
          {
            name: '负荷用电电费',
            type: 'line',
            stack: '总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#9FD7F4'
              }
            },
            data: [30, 40, 50, 60, 50, 40, 30, 35],
            smooth: true
          },
          {
            name: '电池充电花费',
            type: 'line',
            stack: '总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#F09595'
              }
            },
            data: [35, 45, 55, 65, 55, 45, 35, 40],
            smooth: true
          },
          {
            name: '电池放电收益',
            type: 'line',
            stack: '总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#FFE0A1'
              }
            },
            data: [40, 50, 60, 70, 80, 50, 60, 45],
            smooth: true
          },
          {
            name: '汽⻋放电收益',
            type: 'line',
            stack: '总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#18d035'
              }
            },
            data: [40, 50, 60, 70, 80, 50, 60, 45],
            smooth: true
          },
          {
            name: '光伏消纳节约',
            type: 'line',
            stack: '总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#B4ACF5'
              }
            },
            data: [40, 50, 60, 70, 80, 50, 60, 45],
            smooth: true
          },
          {
            name: '光伏并⽹收益',
            type: 'line',
            stack: '总量',
            areaStyle: {},
            symbolSize: 2,
            itemStyle: {
              normal: {
                color: '#FFAA34'
              }
            },
            data: [40, 50, 60, 70, 80, 50, 60, 45],
            smooth: true
          }
        ]
      };
      this.microCostDist.setOption(option);
    },
    // 绘制光伏发电功率
    drawPvpGeneration () {
      var option = {
        title: {
          text: '光伏发电功率',
          x: 20,
          textStyle: {
            fontWeight: 'normal',
            fontSize: 20,
            lineHeight: 28,
            color: '#666666'
          }
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              backgroundColor: '#6a7985'
            }
          }
        },
        grid: {
          x: 50,
          y: 150,
          x2: 50
        },
        legend: {
          textStyle: {
            fontSize: 14
          },
          data: [
            {
              name: '#1光伏',
              icon: 'circle'
            },
            {
              name: '#2光伏',
              icon: 'circle'
            }            
          ],
          top: 40,
          left: 40,
          itemGap: 50
        },
        xAxis: [
          {
            type: 'category',
            boundaryGap: false,
            name: '时间',
            nameTextStyle: {
              color: '#999999',
              fontSize: 14,
              lineHeight: 20
            },
            data: ['2018-09-21', '2018-09-22', '2018-09-23', '2018-09-24', '2018-09-25', '2018-09-26', '2018-09-27'],
            axisLine: {
              show: false,
              onZero: false
            },
            axisTick: {
              show: false
            },
            axisLabel: {
              color: '#999999',
              fontSize: 14,
              lineHeight: 20
            }
          }
        ],
        yAxis: [
          {
            type: 'value',
            data: ['20', '40', '60', '80', '100'],
            name: 'kW',
            nameTextStyle: {
              color: '#999',
              fontSize: 14,
              lineHeight: 20
            },            
            axisLine: {
              show: false,
              onZero: false
            },
            axisTick: {
              show: false
            },
            axisLabel: {
              color: '#999999',
              fontSize: 14,
              lineHeight: 20
            }
          }
        ],
        series: [
          {
            name: '#1光伏',
            type: 'line',
            stack: '总量',
            areaStyle: {},
            itemStyle: {
              normal: {
                color: '#F8CA6D'
              }
            },
            data: [30, 40, 50, 60, 50, 40, 30, 35],
            smooth: true
          },
          {
            name: '#2光伏',
            type: 'line',
            stack: '总量',
            areaStyle: {},
            itemStyle: {
              normal: {
                color: '#B4ACF5'
              }
            },
            data: [30, 40, 50, 60, 50, 40, 30, 35],
            smooth: true
          }          
        ]
      };
      this.pvpGeneration.setOption(option);
    },
    // 绘制微网用电
    drawMicrogridElectricUse () {
      var option = {
        title: {
          text: '微网用电',
          x: 20,
          textStyle: {
            fontWeight: 'normal',
            fontSize: 20,
            lineHeight: 28,
            color: '#666666'
          }
        },    
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              backgroundColor: '#6a7985'
            }
          }
        },
        grid: {
          x: 50,
          y: 150,
          x2: 50
        },
        legend: {
          textStyle: {
            fontSize: 14
          },
          data: [
            {
              name: '尖',
              icon: 'circle'
            },
            {
              name: '峰',
              icon: 'circle'
            },
            {
              name: '平',
              icon: 'circle'
            },
            {
              name: '谷',
              icon: 'circle'
            }
          ],
          top: 40,
          left: 40,
          itemGap: 20
        },
        xAxis: {
          type: 'category',
          name: '时间',
          nameTextStyle: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          },
          data: ['2018-09-21', '2018-09-22', '2018-09-23', '2018-09-24', '2018-09-25', '2018-09-26', '2018-09-27'],
          axisLine: {
            show: true,
            onZero: false,
            lineStyle: {
              color: '#999999'
            }
          },
          axisTick: {
            show: false
          },
          axisLabel: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          },
          boundaryGap: ['25%', '25%']
        },
        yAxis: {
          name: 'kW·h',
          nameTextStyle: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          },
          axisLine: {
            show: false,
            onZero: false
          },
          axisTick: {
            show: false
          },
          axisLabel: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          }
        },
        series: [
          {
            name: '尖',
            type: 'bar',
            barGap: 0,
            data: [5000, 4000, 3000, 5000, 4000, 6000, 8000],
            itemStyle: {
              normal: {
                color: '#B4ACF5'
              }
            }
          },
          {
            name: '峰',
            type: 'bar',
            barGap: 0,
            data: [2000, 7000, 5000, 3000, 5000, 5000, 5000],
            itemStyle: {
              normal: {
                color: '#f09595'
              }
            }
          },
          {
            name: '平',
            type: 'bar',
            barGap: 0,
            data: [5000, 4000, 4500, 4000, 3500, 4300, 6000],
            itemStyle: {
              normal: {
                color: '#bce1f2'
              }
            }
          },
          {
            name: '谷',
            type: 'bar',
            barGap: 0,
            data: [5000, 4000, 6000, 5000, 6000, 4300, 7000],
            itemStyle: {
              normal: {
                color: '#b2db8e'
              }
            }
          }
        ]
      };
      this.microgridElectricUse.setOption(option);
    },
    // 绘制储能充放电功率
    drawEnergyStoreElectricPower () {
      var date = ["2018-09-27T23:00:00","2018-09-27T23:15:00","2018-09-27T23:30:00","2018-09-27T23:45:00","2018-09-28T00:00:00","2018-09-28T00:15:00","2018-09-28T00:30:00","2018-09-28T00:45:00","2018-09-28T01:00:00","2018-09-28T01:15:00","2018-09-28T01:30:00","2018-09-28T01:45:00","2018-09-28T02:00:00","2018-09-28T02:15:00","2018-09-28T02:30:00","2018-09-28T02:45:00","2018-09-28T03:00:00","2018-09-28T03:15:00","2018-09-28T03:30:00","2018-09-28T03:45:00","2018-09-28T04:00:00","2018-09-28T04:15:00","2018-09-28T04:30:00","2018-09-28T04:45:00","2018-09-28T05:00:00","2018-09-28T05:15:00","2018-09-28T05:30:00","2018-09-28T05:45:00","2018-09-28T06:00:00","2018-09-28T06:15:00","2018-09-28T06:30:00","2018-09-28T06:45:00","2018-09-28T07:00:00","2018-09-28T07:15:00","2018-09-28T07:30:00","2018-09-28T07:45:00","2018-09-28T08:00:00","2018-09-28T08:15:00","2018-09-28T08:30:00","2018-09-28T08:45:00","2018-09-28T09:00:00","2018-09-28T09:15:00","2018-09-28T09:30:00","2018-09-28T09:45:00","2018-09-28T11:00:00","2018-09-28T11:15:00","2018-09-28T11:30:00","2018-09-28T11:45:00","2018-09-28T12:00:00","2018-09-28T12:15:00","2018-09-28T12:30:00","2018-09-28T12:45:00","2018-09-28T13:00:00","2018-09-28T13:15:00","2018-09-28T13:30:00","2018-09-28T13:45:00","2018-09-28T14:00:00","2018-09-28T14:15:00","2018-09-28T14:30:00","2018-09-28T14:45:00","2018-09-28T15:00:00","2018-09-28T15:15:00","2018-09-28T15:30:00","2018-09-28T15:45:00","2018-09-28T16:00:00","2018-09-28T16:15:00","2018-09-28T16:30:00","2018-09-28T16:45:00","2018-09-28T17:00:00","2018-09-28T17:15:00","2018-09-28T17:30:00","2018-09-28T17:45:00","2018-09-28T18:00:00","2018-09-28T18:15:00","2018-09-28T18:30:00","2018-09-28T18:45:00","2018-09-28T19:00:00","2018-09-28T19:15:00","2018-09-28T19:30:00","2018-09-28T19:45:00","2018-09-28T20:00:00","2018-09-28T20:15:00","2018-09-28T20:30:00","2018-09-28T20:45:00","2018-09-28T21:00:00","2018-09-28T21:15:00","2018-09-28T21:30:00","2018-09-28T21:45:00","2018-09-28T22:00:00","2018-09-28T22:15:00","2018-09-28T22:30:00","2018-09-28T22:45:00","2018-09-28T23:00:00"]
      var charge = [4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.22,9.95,19.756,25.719999999999995,35.144999999999996,35.284000000000006,40.646000000000008,47.88300000000001,42.432,27.476000000000006,43.554,37.521000000000008,21.456999999999997,21.115,17.527,49.349999999999994,47.899000000000008,47.953,55.263000000000012,54.818999999999996,54.983000000000011,50.771,57.571999999999996,57.687000000000012,54.553,23.723000000000003,16.716,16.767,16.814,22.631999999999998,21.183000000000003,23.276,23.336,21.585,19.649,12.401000000000002,12.432,16.487000000000002,15.698,9.9249999999999989,9.957,10.014999999999999,12.618,10.627,9.963,9.942,19.332,16.022,16.032,19.528,25.251000000000005,25.302,25.378,7.705,13.847999999999999,13.869,7.709,7.711,7.714,7.7170000000000005,7.724]      
      var economyCharge = [4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.22,9.95,19.756,25.719999999999995,35.144999999999996,35.284000000000006,40.646000000000008,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,97.233,90.331000000000017,75.429,98.817000000000007,92.34,76.440000000000012,71.886,75.09899999999999,57.687000000000012,54.553,23.723000000000003,16.716,16.767,16.814,22.631999999999998,21.183000000000003,23.276,23.336,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,29.29,33.497,26.270000000000003,20.141,24.198,23.412,17.642,17.681]
      var dateFormat = [];
      date.forEach((val) => {
        dateFormat.push(val.substr(-8));
      });
      economyCharge = economyCharge.map(function(item) {
        return -item.toFixed(2);
      });
      var chargeFormat = [];
      charge.forEach((val) => {
        chargeFormat.push(val.toFixed(2));
      });
      var option = {
        title: {
          text: '储能充放电功率',
          x: 20,
          textStyle: {
            fontWeight: 'normal',
            fontSize: 20,
            lineHeight: 28,
            color: '#666666'
          }
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              backgroundColor: 'transparent',
              color: 'transparent'
            }
          },
          backgroundColor: 'rgba(0,0,0,0.33)',
          color: '#FFFFFF',
          fontSize: 14,
          lineHeight: 20
        },
        grid: {
          y: 150,
          x2: 50
        },
        legend: {
          textStyle: {
            fontSize: 14
          },
          data: [
            {
              name: '充电功率',
              icon: 'circle'
            },
            {
              name: '放电功率',
              icon: 'circle'
            }
          ],
          top: 40,
          left: 40,
          itemGap: 30
        },
        xAxis: {
          name: '时间',
          nameTextStyle: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          },
          type: 'category',
          boundaryGap: false,
          data: dateFormat,
          axisLine: {
            show: false,
            onZero: false
          },
          axisTick: {
            show: false
          },
          axisLabel: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          }
        },
        yAxis: {
          type: 'value',
          name: 'kW',
          nameTextStyle: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          },
          axisLine: {
            show: false,
            onZero: false
          },
          axisTick: {
            show: false
          },
          axisLabel: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          }
        },
        series: [
          {
            name: '充电功率',
            type: 'line',
            symbolSize: 0,
            itemStyle: {
              normal: {
                color: '#F48686'
              }
            },
            data: chargeFormat,
            smooth: true
          },
          {
            name: '放电功率',
            type: 'line',
            symbolSize: 0,
            itemStyle: {
              normal: {
                color: '#B4ACF5'
              }
            },
            data: economyCharge,
            smooth: true
          }          
        ]
      };
      this.energyStoreElectricPower.setOption(option);
    },
    // 绘制充电对比图
    drawChargeContrast () {
      var date = ["2018-09-27T23:00:00","2018-09-27T23:15:00","2018-09-27T23:30:00","2018-09-27T23:45:00","2018-09-28T00:00:00","2018-09-28T00:15:00","2018-09-28T00:30:00","2018-09-28T00:45:00","2018-09-28T01:00:00","2018-09-28T01:15:00","2018-09-28T01:30:00","2018-09-28T01:45:00","2018-09-28T02:00:00","2018-09-28T02:15:00","2018-09-28T02:30:00","2018-09-28T02:45:00","2018-09-28T03:00:00","2018-09-28T03:15:00","2018-09-28T03:30:00","2018-09-28T03:45:00","2018-09-28T04:00:00","2018-09-28T04:15:00","2018-09-28T04:30:00","2018-09-28T04:45:00","2018-09-28T05:00:00","2018-09-28T05:15:00","2018-09-28T05:30:00","2018-09-28T05:45:00","2018-09-28T06:00:00","2018-09-28T06:15:00","2018-09-28T06:30:00","2018-09-28T06:45:00","2018-09-28T07:00:00","2018-09-28T07:15:00","2018-09-28T07:30:00","2018-09-28T07:45:00","2018-09-28T08:00:00","2018-09-28T08:15:00","2018-09-28T08:30:00","2018-09-28T08:45:00","2018-09-28T09:00:00","2018-09-28T09:15:00","2018-09-28T09:30:00","2018-09-28T09:45:00","2018-09-28T11:00:00","2018-09-28T11:15:00","2018-09-28T11:30:00","2018-09-28T11:45:00","2018-09-28T12:00:00","2018-09-28T12:15:00","2018-09-28T12:30:00","2018-09-28T12:45:00","2018-09-28T13:00:00","2018-09-28T13:15:00","2018-09-28T13:30:00","2018-09-28T13:45:00","2018-09-28T14:00:00","2018-09-28T14:15:00","2018-09-28T14:30:00","2018-09-28T14:45:00","2018-09-28T15:00:00","2018-09-28T15:15:00","2018-09-28T15:30:00","2018-09-28T15:45:00","2018-09-28T16:00:00","2018-09-28T16:15:00","2018-09-28T16:30:00","2018-09-28T16:45:00","2018-09-28T17:00:00","2018-09-28T17:15:00","2018-09-28T17:30:00","2018-09-28T17:45:00","2018-09-28T18:00:00","2018-09-28T18:15:00","2018-09-28T18:30:00","2018-09-28T18:45:00","2018-09-28T19:00:00","2018-09-28T19:15:00","2018-09-28T19:30:00","2018-09-28T19:45:00","2018-09-28T20:00:00","2018-09-28T20:15:00","2018-09-28T20:30:00","2018-09-28T20:45:00","2018-09-28T21:00:00","2018-09-28T21:15:00","2018-09-28T21:30:00","2018-09-28T21:45:00","2018-09-28T22:00:00","2018-09-28T22:15:00","2018-09-28T22:30:00","2018-09-28T22:45:00","2018-09-28T23:00:00"]
      var charge = [4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.22,9.95,19.756,25.719999999999995,35.144999999999996,35.284000000000006,40.646000000000008,47.88300000000001,42.432,27.476000000000006,43.554,37.521000000000008,21.456999999999997,21.115,17.527,49.349999999999994,47.899000000000008,47.953,55.263000000000012,54.818999999999996,54.983000000000011,50.771,57.571999999999996,57.687000000000012,54.553,23.723000000000003,16.716,16.767,16.814,22.631999999999998,21.183000000000003,23.276,23.336,21.585,19.649,12.401000000000002,12.432,16.487000000000002,15.698,9.9249999999999989,9.957,10.014999999999999,12.618,10.627,9.963,9.942,19.332,16.022,16.032,19.528,25.251000000000005,25.302,25.378,7.705,13.847999999999999,13.869,7.709,7.711,7.714,7.7170000000000005,7.724]
      var economyCharge = [4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.202,4.22,9.95,19.756,25.719999999999995,35.144999999999996,35.284000000000006,40.646000000000008,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,97.233,90.331000000000017,75.429,98.817000000000007,92.34,76.440000000000012,71.886,75.09899999999999,57.687000000000012,54.553,23.723000000000003,16.716,16.767,16.814,22.631999999999998,21.183000000000003,23.276,23.336,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,29.29,33.497,26.270000000000003,20.141,24.198,23.412,17.642,17.681]
      var dateFormat = [];
      date.forEach((val) => {
        dateFormat.push(val.substr(-8));
      });
      var chargeFormat = [];
      charge.forEach((val) => {
        chargeFormat.push(val.toFixed(2));
      });
      var economyChargeFormat = [];
      economyCharge.forEach((val) => {
        economyChargeFormat.push(val.toFixed(2));
      });
      var option = {
        title: {
          text: '充电对比图',
          x: 20,
          textStyle: {
            fontWeight: 'normal',
            fontSize: 20,
            lineHeight: 28,
            color: '#666666'
          }
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              backgroundColor: '#6a7985'
            }
          }
        },
        grid: {
          x: 30,
          y: 150,
          x2: 50
        },
        legend: {
          textStyle: {
            fontSize: 14
          },
          data: [
            {
              name: '经济充电',
              icon: 'circle'
            },
            {
              name: '立即充电',
              icon: 'circle'
            }
          ],
          top: 40,
          left: 40,
          itemGap: 30
        },
        xAxis: {
          type: 'category',
          name: '时间',
          nameTextStyle: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          },
          data: dateFormat,
          axisLine: {
            show: true,
            onZero: false,
            lineStyle: {
              color: '#999999'
            }
          },
          axisTick: {
            show: false
          },
          axisLabel: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          },
          boundaryGap: ['25%', '25%']
        },
        yAxis: {
          name: 'kW',
          nameTextStyle: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          },
          axisLine: {
            show: false,
            onZero: false
          },
          axisTick: {
            show: false
          },
          axisLabel: {
            color: '#999999',
            fontSize: 14,
            lineHeight: 20
          }
        },
        series: [
          {
            data: economyChargeFormat,
            name: '经济充电',
            type: 'line',
            itemStyle: {
              normal: {
                color: '#F48686'
              }
            },
            smooth: true
          },
          {
            data: chargeFormat,
            name: '立即充电',
            type: 'line',
            itemStyle: {
              normal: {
                color: '#A8E52E'
              }
            },
            smooth: true
          }
        ]
      };
      this.chargeContrast.setOption(option);
    }
  }
};
</script>

<style scoped>
@charset 'utf-8';
@font-face {
  font-family: 'unidream';
  src: url('../../static/css/fonts/UnidreamLED.ttf');
  font-weight: normal;
  font-style: normal;
}
@media screen and (min-width:1784px) and (max-width:1920px) {
  .electric-charge {
    width: 68.2%;
    height: 440px;
    margin-left: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    float: left;
  }
  span {
    display: inline-block;
  }
  .charge-ratio-left-title {
    margin-top: 77px;
    font-size: 16px;
    width: 80px;
    line-height: 22px;
    color: #333333;
    float: left;
  }
  .total-electrical-output-title,
  .total-electrical-use-title {
    margin-bottom: 67px;
  }
  .charge-ratio-left-num {
    float: left;
    margin-top: 60px;
  }
  .total-electrical-output-num,
  .total-electrical-use-num,
  .energy-storage-num {
    margin-bottom: 22px;
    font-size: 50px;
    line-height: 60px;
    color: #52AFEE;
    border-bottom: 1px solid #ECECEC;
    width: 135px;
    margin-left: 19px;
  }
  .charge-ratio-left-unit {
    float: left;
    margin-top: 89px;
    width: 35px;
    margin-left: 9px;
  }
  .total-electrical-output-unit,
  .total-electrical-use-unit,
  .energy-storage-unit {
    font-size: 16px;
    line-height: 22px;
    margin-bottom: 66px;
    color: #666666;
  }

  #power-generation-ratio,
  #power-use-ratio {
    width: 300px;
    height: 300px;
  }
  .electric-charge-content {
    display: flex;
    justify-content: space-around;
    width: 100%;
  }
  .safe-run-content {
    width: 27.8%;
    height: 84px;
    float: left;
    margin-left: 1%;
    margin-top: 20px;
    background-color: #FFFFFF;
    border-radius: 4px;
    border-left: 10px solid #63A7E8;
  }
  .safe-run-days {
    height: 100%;
    display: flex;
    justify-content: space-around;
  }
  .safe-run-days>div {
    line-height: 84px;
  }
  .safe-run-days-img {
    font-size: 16px;
    width: 25%;
  }
  .safe-run-days-img>span {
    display: inline;
    margin-left: 1.3%;
  }
  .safe-run-days-count {
    color: #666666;
    font-size: 50px;
  }
  .safe-run-days-unit {
    margin-right: 8.8%;
    font-size: 16px;
  }
  .safe-run-data {
    width: 27.8%;
    height: 335px;
    float: left;
    margin-left: 1%;
    margin-top: 20px;
    background-color: #FFFFFF;
    border-radius: 4px;
    border-left: 10px solid #63A7E8;
  }
  .safe-run-data>div {
    width: 43.2%;
    height: 21.5%;
    line-height: 72px;
    background: #EEF1FA;
    border-radius: 4px;
    float: left;
    padding-left: 10px;
    display: flex;
    justify-content: space-around;
  }
  .safe-run-data>span {
    display: inline;
  }
  .running-state {
    justify-content: space-between!important;
  }
  .running-state>span:last-child {
    margin-right: 60px!important;
  }
  .safe-run-data>div>span:last-child {
    margin-right: 15px;
  }
  .system-frequency>span:last-child {
    margin-right: 6px;
  }
  .alternating-generatrix-voltage,
  .dc-generatrix-voltage,
  .system-frequency {
    margin-left: 5.4%;
  }
  .running-state,
  .dot-power {
    margin-left: 3.4%;
  }
  .alternating-generatrix-voltage,
  .running-state {
    margin-top: 40px;
  }
  .dc-generatrix-voltage,
  .dot-power,
  .system-frequency {
    margin-top: 18px;
  }
  .alternating-generatrix-voltage-data,
  .dc-generatrix-voltage-data,
  .dot-power-data {
    color: #52AFEE;
    font-size: 30px;
    margin-right: 6.1%;
  }
  .system-frequency-data {
    color: #DB0822;
    font-size: 30px;
    margin-left: 14.8%;
    margin-right: 6.1%;
  }
  .microgrid-dist,
  .microgrid-electric {
    width: 68.2%;
    height: 484px;
    margin-left: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    float: left;
  }
  #microgrid-elec-dist,
  #microgrid-cost-dist,
  #pvp-generation,
  #microgrid-electric-use {
    width: 47%;
    height: 90%;
    float: left;
    margin-left: 2%;
    margin-top: 2%;
  }
  .energy-store-electric {
    width: 27.8%;
    height: 990px;
    float: right;
    margin-right: 1.4%;
    margin-top: -485px;
    background-color: #FFFFFF;
    border-radius: 4px;
  }
  #energy-store-electric-power {
    width: 90%;
    height: 450px;
    margin-top: 4%;
  }
  #charge-contrast {
    width: 90%;
    height: 450px;
    margin-top: 8%;
  }
}
@media screen and (min-width:1315px) and (max-width:1783px) {
  .electric-charge {
    width: 66.2%;
    height: 440px;
    margin-left: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    float: left
  }
  span {
    display: inline-block;
  }
  .charge-ratio-left-title {
    margin-top: 77px;
    font-size: 15px;
    width: 80px;
    line-height: 22px;
    color: #333333;
    float: left;
  }
  .total-electrical-output-title,
  .total-electrical-use-title {
    margin-bottom: 67px;
  }
  .charge-ratio-left-num {
    float: left;
    margin-top: 60px;
  }
  .total-electrical-output-num,
  .total-electrical-use-num,
  .energy-storage-num {
    margin-bottom: 22px;
    font-size: 50px;
    line-height: 60px;
    color: #52AFEE;
    border-bottom: 1px solid #ECECEC;
    width: 135px;
    margin-left: 19px;
  }
  .charge-ratio-left-unit {
    float: left;
    margin-top: 89px;
    width: 35px;
    margin-left: 9px;
  }
  .total-electrical-output-unit,
  .total-electrical-use-unit,
  .energy-storage-unit {
    font-size: 15px;
    line-height: 22px;
    margin-bottom: 66px;
    color: #666666;
  }

  #power-generation-ratio,
  #power-use-ratio {
    width: 300px;
    height: 300px;
  }
  .electric-charge-content {
    display: flex;
    justify-content: space-around;
    width: 100%;
  }
  .safe-run-content {
    width: 29.8%;
    height: 84px;
    float: left;
    margin-left: 1%;
    margin-top: 20px;
    background-color: #FFFFFF;
    border-radius: 4px;
    border-left: 10px solid #63A7E8;
  }
  .safe-run-days {
    display: flex;
    justify-content: space-around;
  }
  .safe-run-days>div {
    line-height: 84px;
  }
  .safe-run-days-img {
    font-size: 15px;
    width: 25%;
  }
  .safe-run-days-img>span {
    display: inline;
    margin-left: 1.3%;
  }
  .safe-run-days-count {
    color: #666666;
    font-size: 50px;
  }
  .safe-run-days-unit {
    margin-right: 8.8%;
    font-size: 15px;
  }
  .safe-run-data {
    width: 29.8%;
    height: 335px;
    float: left;
    margin-left: 1%;
    margin-top: 20px;
    background-color: #FFFFFF;
    border-radius: 4px;
    border-left: 10px solid #63A7E8;
  }
  .safe-run-data>div {
    width: 43.2%;
    height: 21.5%;
    line-height: 72px;
    background: #EEF1FA;
    border-radius: 4px;
    float: left;
    padding-left: 5px;
    display: flex;
    justify-content: space-around;
  }
  .safe-run-data>span {
    display: inline;
  }
  .system-frequency>span:last-child {
    margin-right: 6px;
  }
  .alternating-generatrix-voltage,
  .dc-generatrix-voltage,
  .system-frequency {
    margin-left: 5.4%;
  }
  .running-state,
  .dot-power {
    margin-left: 3.4%;
  }
  .alternating-generatrix-voltage,
  .running-state {
    margin-top: 40px;
  }
  .dc-generatrix-voltage,
  .dot-power,
  .system-frequency {
    margin-top: 18px;
  }
  .alternating-generatrix-voltage-data,
  .dc-generatrix-voltage-data,
  .dot-power-data {
    color: #52AFEE;
    font-size: 26px;
  }
  .system-frequency-data {
    color: #DB0822;
    font-size: 26px;
    margin-left: 14.8%;
  }
  .microgrid-dist,
  .microgrid-electric {
    width: 66.2%;
    height: 484px;
    margin-left: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    float: left;
  }
  #microgrid-elec-dist,
  #microgrid-cost-dist,
  #pvp-generation,
  #microgrid-electric-use {
    width: 47%;
    height: 90%;
    float: left;
    margin-left: 2%;
    margin-top: 2%;
  }
  .energy-store-electric {
    width: 29.8%;
    height: 990px;
    float: right;
    margin-right: 1.4%;
    margin-top: -485px;
    background-color: #FFFFFF;
    border-radius: 4px;
  }
  #energy-store-electric-power {
    width: 90%;
    height: 450px;
    margin-top: 4%;
  }
  #charge-contrast {
    width: 90%;
    height: 450px;
    margin-top: 8%;
  }
}
@media screen and (min-width:878px) and (max-width:1314px) {
  .electric-charge {
    width: 96.8%;
    height: 440px;
    margin-left: 1.6%;
    margin-right: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
  }
  span {
    display: inline-block;
  }
  .charge-ratio-left {
    margin-left: 5px;
  }
  .charge-ratio-left-title {
    margin-top: 77px;
    font-size: 16px;
    width: 80px;
    line-height: 22px;
    color: #333333;
    float: left;
  }
  .total-electrical-output-title,
  .total-electrical-use-title {
    margin-bottom: 67px;
  }
  .charge-ratio-left-num {
    float: left;
    margin-top: 60px;
  }
  .total-electrical-output-num,
  .total-electrical-use-num,
  .energy-storage-num {
    margin-bottom: 22px;
    font-size: 40px;
    line-height: 60px;
    color: #52AFEE;
    border-bottom: 1px solid #ECECEC;
    width: 100px;
    margin-left: 10px;
  }
  .charge-ratio-left-unit {
    float: left;
    margin-top: 89px;
    width: 35px;
    margin-left: 9px;
  }
  .total-electrical-output-unit,
  .total-electrical-use-unit,
  .energy-storage-unit {
    font-size: 16px;
    line-height: 22px;
    margin-bottom: 66px;
    color: #666666;
  }
  #power-generation-ratio,
  #power-use-ratio {
    width: 300px;
    height: 300px;
  }
  .electric-charge-content {
    display: flex;
    justify-content: space-around;
    width: 100%;
  }
  .safe-run-content {
    width: 96.8%;
    height: 84px;
    margin-left: 1.6%;
    margin-right: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    border-left: 10px solid #63A7E8;
  }
  .safe-run-days {
    display: flex;
    justify-content: space-around;
  }
  .safe-run-days>div {
    line-height: 84px;
  }
  .safe-run-days-img {
    font-size: 16px;
  }
  .safe-run-days-img>span {
    display: inline;
  }
  .safe-run-days-count {
    color: #666666;
    font-size: 50px;
  }
  .safe-run-days-unit {
    margin-right: 8.8%;
    font-size: 16px;
  }
  .safe-run-data {
    width: 96.8%;
    height: 84px;
    margin-left: 1.6%;
    margin-right: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    border-left: 10px solid #63A7E8;
    display: flex;
    justify-content: space-around;
  }
  .safe-run-data>div {
    line-height: 72px;
    width: 19%;
    height: 72px;
    text-align: center;
    background: #EEF1FA;
    border-radius: 4px;
    margin-top: 5px;
  }
  .safe-run-data>div>span:first-child {
    margin-right: 5px;
  }
  .alternating-generatrix-voltage-data,
  .dc-generatrix-voltage-data,
  .dot-power-data {
    color: #52AFEE;
    font-size: 22px;
  }
  .system-frequency-data {
    color: #DB0822;
    font-size: 22px;
  }
  .microgrid-dist,
  .microgrid-electric,
  .energy-store-electric {
    width: 96.8%;
    height: 484px;
    margin-left: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    float: left;
  }
  #microgrid-elec-dist,
  #microgrid-cost-dist,
  #pvp-generation,
  #microgrid-electric-use,
  #energy-store-electric-power,
  #charge-contrast {
    width: 45%;
    height: 90%;
    float: left;
    margin-left: 5%;
    margin-top: 2%;
  }
}
@media screen and (min-width:557px) and (max-width:877px) {
  .electric-charge {
    width: 96.8%;
    height: 1120px;
    border-radius: 4px;
    background-color: #FFFFFF;
    margin-left: 1.6%;
    margin-right: 1.6%;
    margin-top: 20px;
    min-width: 350px;
  }
  .total-electrical-output-num,
  .total-electrical-use-num,
  .energy-storage-num {
    margin-bottom: 22px;
    font-size: 40px;
    line-height: 60px;
    color: #52AFEE;
    border-bottom: 1px solid #ECECEC;
    width: 135px;
    margin-left: 19px;
  }
  .charge-ratio-left-title {
    font-size: 16px;
    width: 80px;
    line-height: 22px;
    color: #333333;
    margin-top: 77px;
  }
  .charge-ratio-left {
    height: 300px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    justify-content: space-around;
  }
  .charge-ratio-middle {
    height: 400px;
    margin: 0 auto;
    text-align: center;
  }
  .charge-ratio-right {
    height: 400px;
    margin: 0 auto;
    text-align: center;
  }
  .total-electrical-output-title,
  .total-electrical-use-title {
    margin-bottom: 67px;
  }

  .charge-ratio-left-num {
    margin-top: 60px;
  }

  .charge-ratio-left-unit {
    margin-top: 89px;
    width: 35px;
    margin-left: 9px;
  }
  .total-electrical-output-unit,
  .total-electrical-use-unit,
  .energy-storage-unit {
    font-size: 16px;
    line-height: 22px;
    margin-bottom: 66px;
    color: #666666;
  }
  #power-generation-ratio,
  #power-use-ratio {
    width: 350px;
    height: 350px;
    margin: 0 auto;
  }
  .safe-run-content {
    width: 96.8%;
    height: 84px;
    margin-left: 1.6%;
    margin-right: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    border-left: 10px solid #63A7E8;
  }
  .safe-run-days {
    display: flex;
    justify-content: space-around;
  }
  .safe-run-days>div {
    line-height: 84px;
  }
  .safe-run-days-img {
    font-size: 16px;
  }
  .safe-run-days-img>span {
    display: inline;
  }
  .safe-run-days-count {
    color: #666666;
    font-size: 36px;
  }
  .safe-run-days-unit {
    margin-right: 8.8%;
    font-size: 16px;
  }
  .safe-run-data {
    width: 96.8%;
    height: 164px;
    margin-left: 1.6%;
    margin-right: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    border-left: 10px solid #63A7E8;
  }
  .safe-run-data>div {
    float: left;
    line-height: 72px;
    width: 30%;
    height: 72px;
    margin-top: 6px;
    text-align: center;
    background: #EEF1FA;
    margin-left: 2.5%;
    border-radius: 4px;
  }
  .safe-run-data>div>span:first-child {
    margin-right: 5px;
  }
  .alternating-generatrix-voltage-data,
  .dc-generatrix-voltage-data,
  .dot-power-data {
    color: #52AFEE;
    font-size: 22px;
  }
  .system-frequency-data {
    color: #DB0822;
    font-size: 22px;
  }
  .microgrid-dist,
  .microgrid-electric,
  .energy-store-electric {
    width: 96.8%;
    height: 840px;
    margin-left: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    float: left;
  }
  #microgrid-elec-dist,
  #microgrid-cost-dist,
  #pvp-generation,
  #microgrid-electric-use,
  #energy-store-electric-power,
  #charge-contrast {
    width: 90%;
    height: 400px;
    float: left;
    margin-left: 5%;
    margin-top: 2%;
  }
}
/* @media screen and (min-width:367px) and (max-width:556px) {
  .electric-charge {
    width: 96.8%;
    height: 1120px;
    border-radius: 4px;
    background-color: #FFFFFF;
    margin-left: 1.6%;
    margin-right: 1.6%;
    margin-top: 20px;
    min-width: 350px;
  }
  .total-electrical-output-num,
  .total-electrical-use-num,
  .energy-storage-num {
    margin-bottom: 22px;
    font-size: 40px;
    line-height: 60px;
    color: #52AFEE;
    border-bottom: 1px solid #ECECEC;
    width: 135px;
    margin-left: 19px;
  }
  .charge-ratio-left-title {
    font-size: 16px;
    width: 80px;
    line-height: 22px;
    color: #333333;
    margin-top: 77px;
  }
  .charge-ratio-left {
    height: 300px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    justify-content: space-around;
  }
  .charge-ratio-middle {
    height: 400px;
    margin: 0 auto;
    text-align: center;
  }
  .charge-ratio-right {
    height: 400px;
    margin: 0 auto;
    text-align: center;
  }
  .total-electrical-output-title,
  .total-electrical-use-title {
    margin-bottom: 67px;
  }

  .charge-ratio-left-num {
    margin-top: 60px;
  }

  .charge-ratio-left-unit {
    margin-top: 89px;
    width: 35px;
    margin-left: 9px;
  }
  .total-electrical-output-unit,
  .total-electrical-use-unit,
  .energy-storage-unit {
    font-size: 16px;
    line-height: 22px;
    margin-bottom: 66px;
    color: #666666;
  }
  #power-generation-ratio,
  #power-use-ratio {
    width: 350px;
    height: 350px;
    margin: 0 auto;
  }
  .safe-run-content {
    width: 96.8%;
    height: 84px;
    margin-left: 1.6%;
    margin-right: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    border-left: 10px solid #63A7E8;
  }
  .safe-run-days {
    display: flex;
    justify-content: space-around;
  }
  .safe-run-days>div {
    line-height: 84px;
  }
  .safe-run-days-img {
    font-size: 16px;
  }
  .safe-run-days-img>span {
    display: inline;
  }
  .safe-run-days-count {
    color: #666666;
    font-size: 36px;
  }
  .safe-run-days-unit {
    margin-right: 8.8%;
    font-size: 16px;
  }
  .safe-run-data {
    width: 96.8%;
    height: 240px;
    margin-left: 1.6%;
    margin-right: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    border-left: 10px solid #63A7E8;
  }
  .safe-run-data>div {
    float: left;
    line-height: 72px;
    width: 46%;
    height: 72px;
    margin-top: 6px;
    text-align: center;
    background: #EEF1FA;
    margin-left: 3%;
    border-radius: 4px;
  }
  .safe-run-data>div>span:first-child {
    margin-right: 5px;
  }
  .alternating-generatrix-voltage-data,
  .dc-generatrix-voltage-data,
  .dot-power-data {
    color: #52AFEE;
    font-size: 22px;
  }
  .system-frequency-data {
    color: #DB0822;
    font-size: 22px;
  }
  .microgrid-dist,
  .microgrid-electric,
  .energy-store-electric {
    width: 96.8%;
    height: 840px;
    margin-left: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    float: left;
  }
  #microgrid-elec-dist,
  #microgrid-cost-dist,
  #pvp-generation,
  #microgrid-electric-use,
  #energy-store-electric-power,
  #charge-contrast {
    width: 90%;
    height: 400px;
    float: left;
    margin-left: 5%;
    margin-top: 2%;
  }
} */
@media screen and (max-width:566px) {
  .electric-charge {
    width: 96.8%;
    height: 1120px;
    border-radius: 4px;
    background-color: #FFFFFF;
    margin-left: 1.6%;
    margin-right: 1.6%;
    margin-top: 20px;
    min-width: 350px;
  }
  .total-electrical-output-num,
  .total-electrical-use-num,
  .energy-storage-num {
    margin-bottom: 22px;
    font-size: 40px;
    line-height: 60px;
    color: #52AFEE;
    border-bottom: 1px solid #ECECEC;
    width: 135px;
    margin-left: 19px;
  }
  .charge-ratio-left-title {
    font-size: 16px;
    width: 80px;
    line-height: 22px;
    color: #333333;
    margin-top: 77px;
  }
  .charge-ratio-left {
    height: 300px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    justify-content: space-around;
  }
  .charge-ratio-middle {
    height: 400px;
    margin: 0 auto;
    text-align: center;
  }
  .charge-ratio-right {
    height: 400px;
    margin: 0 auto;
    text-align: center;
  }
  .total-electrical-output-title,
  .total-electrical-use-title {
    margin-bottom: 67px;
  }

  .charge-ratio-left-num {
    margin-top: 60px;
  }

  .charge-ratio-left-unit {
    margin-top: 89px;
    width: 35px;
    margin-left: 9px;
  }
  .total-electrical-output-unit,
  .total-electrical-use-unit,
  .energy-storage-unit {
    font-size: 16px;
    line-height: 22px;
    margin-bottom: 66px;
    color: #666666;
  }
  #power-generation-ratio,
  #power-use-ratio {
    width: 350px;
    height: 350px;
    margin: 0 auto;
  }
  .safe-run-content {
    width: 96.8%;
    height: 84px;
    margin-left: 1.6%;
    margin-right: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    border-left: 10px solid #63A7E8;
  }
  .safe-run-days {
    display: flex;
    justify-content: space-around;
  }
  .safe-run-days>div {
    line-height: 84px;
  }
  .safe-run-days-img {
    font-size: 16px;
  }
  .safe-run-days-img>span {
    display: inline;
  }
  .safe-run-days-count {
    color: #666666;
    font-size: 36px;
  }
  .safe-run-days-unit {
    margin-right: 8.8%;
    font-size: 16px;
  }
  .safe-run-data {
    width: 96.8%;
    height: 400px;
    margin-left: 1.6%;
    margin-right: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    border-left: 10px solid #63A7E8;
  }
  .safe-run-data>div {
    float: left;
    line-height: 72px;
    width: 90%;
    height: 72px;
    margin-top: 6px;
    text-align: center;
    background: #EEF1FA;
    margin-left: 5%;
    border-radius: 4px;
  }
  .safe-run-data>div>span:first-child {
    margin-right: 5px;
  }
  .alternating-generatrix-voltage-data,
  .dc-generatrix-voltage-data,
  .dot-power-data {
    color: #52AFEE;
    font-size: 22px;
  }
  .system-frequency-data {
    color: #DB0822;
    font-size: 22px;
  }
  .microgrid-dist,
  .microgrid-electric,
  .energy-store-electric {
    width: 96.8%;
    height: 840px;
    margin-left: 1.6%;
    margin-top: 20px;
    background: #FFFFFF;
    border-radius: 4px;
    float: left;
  }
  #microgrid-elec-dist,
  #microgrid-cost-dist,
  #pvp-generation,
  #microgrid-electric-use,
  #energy-store-electric-power,
  #charge-contrast {
    width: 90%;
    height: 400px;
    float: left;
    margin-left: 5%;
    margin-top: 2%;
  }
}
.electric-charge-date {
  width: 220px;
  height: 34px;
  position: relative;
  left: 30px;
  top: 14px;
}
hr {
  margin-top: 30px;
  margin-left: 1.6%;
  margin-right: 3.4%;
}
.electric-charge,
.safe-run-days,
.safe-run-data,
.microgrid-dist,
.microgrid-electric,
.energy-store-electric {
  box-shadow: 2px 2px 4px rgba(188,182,182,0.5);
}
.total-electrical-output-num,
.total-electrical-use-num,
.energy-storage-num,
.alternating-generatrix-voltage-data,
.dc-generatrix-voltage-data,
.dot-power-data,
.system-frequency-data,
.safe-run-days-count {
  font-family: 'unidream';
}
</style>
